home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#10 (Jul 86)
/
modula source
/
PBFileManagerASM.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-04-10
|
927b
|
37 lines
; Tom Taylor
; 3707 Poinciana Dr. #137
; Santa Clara, CA 95051
;
; The one procedure in this
; file is used to implement
; all of the PB calls. The
; higher level Modula-2 program
; (PBFileManager.MOD)
; passes in the actual value
; of the PB trap and the
; procedure here modifies itself
; to execute that trap.
DC.W LowLevelPB
asyncTrpBit EQU $400
; PROCEDURE LowLevelPB (pBlk: ParmBlkPtr;
; async: BOOLEAN;
; trap: CARDINAL;
; selector: INTEGER) : OsErr;
LowLevelPB:
MOVE.W (A4)+,D0 ; get trap selector (HFS only)
MOVE.W (A4)+,D1 ; get trap value
TST.W (A4)+ ; check for async call
BEQ.S NotAsync ; nope
ORI.W #asyncTrpBit,D1 ; yep, make trap async
NotAsync:
LEA Trapper,A0 ; get address of trap location
MOVE.W D1,(A0) ; install trap
MOVE.L (A4)+,A0 ; get param block address
Trapper:
DC.W 0 ; PB Trap goes here
MOVE.W D0,-(A4) ; return result
RTS